/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

/**
 *
 * @author djordje
 */
public class StackFiles {

    static String path = "F:\\MATLAB\\GCRF for heterogeneous data\\H-GCRF_HCUP_v2.1\\pctdata\\grid_prec_synth\\";
    static int numberOfTimesteps = 4;
    static int numberOfPredictors=3;

    public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, IOException {
        BufferedReader br = null;
        for (int pred = 1; pred <= numberOfPredictors; pred++) {
            
                String partOne = path + "\\podaci_ts_training_precitor_" + (pred + 1) + "_clusters.csv";
                String partTwo = path + "\\podaci_ts_test_precitor_" + (pred + 1) + "_clusters.csv";
                String combinedResults = path + "\\podaci_tsall_precitor_" + (pred + 1) + "_clusters.csv";

//                PrintWriter writer = new PrintWriter(new FileWriter(combinedResults, true));
//                System.out.println("Starting to write to file: " + path + "/podaci_predictor_" + (i + 1) + "_tsall.csv");
//                for (int j = 0; j < files.get(i).size(); j++) {
//                System.out.println("    + Reading data from file: " + files.get(i).get(j));
//                br = new BufferedReader(new FileReader(files.get(i).get(j)));
//
//                String line = br.readLine();
//                while (line != null) {
//                    if (!line.equals("") && line != null) {
//                        writer.println(line);
//                        writer.flush();
//                    }
//                    line = br.readLine();
//                }
//                System.out.println("    - Finished reading data from file" + files.get(i).get(j));
//                br.close();
            }
//            writer.close();
                
        }
        
        

//        for (int i = 0; i < files.size(); i++) {
//            PrintWriter writer = new PrintWriter(path + "/podaci_predictor_" + (i + 1) + "_tsall.csv", "UTF-8");
//            System.out.println("Starting to write to file: " + path + "/podaci_predictor_" + (i + 1) + "_tsall.csv");
//            for (int j = 0; j < files.get(i).size(); j++) {
//                System.out.println("    + Reading data from file: " + files.get(i).get(j));
//                br = new BufferedReader(new FileReader(files.get(i).get(j)));
//
//                String line = br.readLine();
//                while (line != null) {
//                    if (!line.equals("") && line != null) {
//                        writer.println(line);
//                        writer.flush();
//                    }
//                    line = br.readLine();
//                }
//                System.out.println("    - Finished reading data from file" + files.get(i).get(j));
//                br.close();
//            }
//            writer.close();
//        }
//    }
}
